using System;
using System.Collections.Generic;
using System.Text;

namespace RStarTree
{
    interface Node
    {
          int getNoOfData(); // returns number of data entries
                                            // behind that node
          Data get(int i);   // returns the i-th object in the 
                                            // tree lying behind that node
    
          void readFromBuffer(byte[] buffer) ;
                         // reads data from buffer
         void writeToBuffer(byte[] buffer);
                        // writes data to buffer

          bool isDataNode();	// returns TRUE, if "this" is RTDataNode 

          float[] getMBR();      // returns mbr enclosing whole page
          void print();          // prints rectangles
  
          void nearestNeighborSearch(PPoint point, PPoint nearest, float nearestDistance);

         void nearestNeighborSearch(PPoint point, SortedLinList res, float nearestDistance);

         void pointQuery(PPoint p, SortedLinList res);
  
         void rangeQuery(float[] mbr, SortedLinList res);

         void rangeQuery(PPoint center, float radius, SortedLinList res); 
  
         void ringQuery(PPoint center, float radius1, float radius2, SortedLinList res);

         void range_nnQuery(float[] mbr, SortedLinList res, 
				PPoint center, float nearestDistance,
				PPoint nearest, bool success);

          void overlapping(float[] p, int[] nodes_t);
          void nodes(int[] nodes_a);
        /************************************************************************/
        /*  inserts d recursively, if there occurs a split, FALSE will be
            returned and in sn a pointer to the new node                                                                     */
        /************************************************************************/
          int insert(Data d, RTNode[] sn); 
                                        
        
       /************************************************************************/
       /* prints all entries sectioning mbr                                                                     */
       /************************************************************************/
          void region(float[] mbr);
         //prints all entries equal to p
          void pointQuery(float[] p); 
                                        
    // void constraints_query(rectangle rect, double[] distance, short direction, short MBRtopo, short topology, SortedLinList res);
  	                                      
   void delete();
    }
}
